import request from '@/utils/request'

// 查询设备版本列表
export function listVersion(query) {
  return request({
    url: '/version/list',
    method: 'get',
    params: query
  })
}

// 查询设备版本详细
export function getVersion(versionId) {
  return request({
    url: '/version/' + versionId,
    method: 'get'
  })
}

// 新增设备版本
export function addVersion(data) {
  return request({
    url: '/version',
    method: 'post',
    data: data
  })
}

// 修改设备版本
export function updateVersion(data) {
  return request({
    url: '/version',
    method: 'put',
    data: data
  })
}

// 删除设备版本
export function delVersion(versionId) {
  return request({
    url: '/version/' + versionId,
    method: 'delete'
  })
}

// 设备型号下拉框数据
export function getDeviceMode(params) {
  return request({
    url: '/deviceMode/modelInfo',
    method: 'get',
    params
  })
}

// 点击推送
export function clickPush(data) {
  return request({
    url: '/versionPushTotalLog',
    method: 'POST',
    data
  })
}

// 资料推送
export function getPush(data) {
  return request({
    url: '/version/' + data,
    method: 'get',
  })
}

// 推送更新
export function pushProject(data) {
  return request({
    url: '/versionPushLog',
    method: 'POST',
    data
  })
}

// 推送记录
export function pushLog(data,params) {
  return request({
    url: '/versionPushTotalLog/byVersionId/' + data,
    method: 'get',
    params
  })
}

// 推送记录查看
export function pushLogCheck(params) {
  return request({
    url: '/versionPushLog/logList',
    method: 'get',
    params
  })
}

// 推送记录查看
export function down(data) {
  return request({
    url: '/file/downOneFile',
    method: 'post',
    data
  })
}

// 推送记录查看
export function cancelMonitor(data) {
  return request({
    url: '/versionPushLog/cancelMonitor',
    method: 'PUT',
    data
  })
}

